<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>测试相对定位</title>
    <style>
        div.fixed{
            position: relative;
            left:50px;
            top:50px;
            z-index: -10;
        }
        .ad {
            width: 400px;
            height: 300px;
            /*实现子元素在父容器中绝对定位的要素*/
            /*position: fixed;*/
            position: fixed;
            right: 0;
            bottom: 0;
            /*left:500px;*/
        }
        .ad .close{
            display: block;
            position: absolute;
            right: 0;
            top: 0;
        }

    </style>
</head>
<body>
<div class="ad">
    <img src="image/npx.jpg">
    <img src="image/cancle.png" alt="" class="close">
</div>
<p>aaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaa</p>
<div style="width:500px;height: 1000px;">asfasfdasdfsd</div>
<p>aaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaa</p>

</body>
</html>